home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / bangermenu / bangermenu.asm < prev    next >
Assembly Source File  |  1980-01-03  |  17KB  |  736 lines

  1. ;Programm: BangerMenu bietet eine grafische Oberfläche zum Anwählen von Programmen
  2. ;          die beim Starten in der Startup-Sequence aufgerufen werden sollen.
  3. ;Autor   : Andre´ Trettin
  4. ;Codename: Banger
  5. ;Begin   : 31-Mai-95 17:08:28
  6. ;$VER    : BangerMenu.Asm 1.210 (30-Aug-95)
  7.  
  8. ** INCLUDE Struktur Variablen
  9. * Fehler Codes: 21=kein Speicher
  10. *               22=konnte Library (oder Libraries) nicht öffnen
  11. *               23=GetVisualInfo Fehler
  12. *               24=konnte File S:Banger.Prefs nicht öffnen
  13. *               25=bei der Gadgeterschaffung trat ein Fehler auf
  14. *               26=konnte Fenster nicht öffnen oder Task nicht Finden
  15. *               27=Einstellungen sind Leer
  16. *               28=kein Speicher für die Einstellungen
  17. *               29=kein MsgPort
  18. *               30=konnte kein IORequest create
  19. *               31=konnte Device nicht öffnen
  20. *               32=falsche Parameter angabe
  21. *               10=Return Code für die Startup-Sequence
  22.  
  23.     incdir  INCLUDE:
  24.     include exec/exec.i
  25.     include exec/io.i
  26.     include devices/input.i
  27.     include devices/inputevent.i
  28.     include dos/dos.i
  29.     include dos/dosextens.i
  30.     include intuition/intuition.i
  31.     include libraries/gadtools.i
  32.     include lvo/exec_lib.i
  33.     include lvo/dos_lib.i
  34.     include lvo/intuition_lib.i
  35.     include lvo/gadtools_lib.i
  36.     include lvo/input_lib.i
  37.  
  38.     STRUCTURE Internal,0
  39.     APTR    INTUIBase
  40.     APTR    DOSBase
  41.     APTR    GADBase
  42.     APTR    WindowHandle
  43.     APTR    OutputHandle
  44.     APTR    ScreenHandle
  45.     APTR    VisualInfo
  46.     APTR    PrefsFileHandle
  47.     APTR    FileSpeicher
  48.     APTR    FontAddr
  49.     APTR    GadgetListe
  50.     APTR    meinTask
  51.     APTR    alterTask
  52.     APTR    AnGad
  53.     APTR    MsgPortAddr
  54.     APTR    RDArgs
  55.     STRUCT  FIB,[fib_SIZEOF]
  56.     STRUCT  GadgetAddr,[68*4]
  57.     STRUCT  TastenIBlock,[IO_SIZE]
  58.     LONG    Filegroesse
  59.     LONG    NOKEYArray
  60.     WORD    BreiteGADs
  61.     WORD    BreiteWin
  62.     WORD    CAPS
  63.     BYTE    AnzahlGADs
  64.     BYTE    RelativeTopC
  65.     BYTE    RelativeLeftC
  66.     LABEL   Int_SIZEOF
  67. ;;
  68. ** Hauptprog
  69.     moveq   #0,d7
  70.     move.l  4.w,a6
  71.     move.l  #Int_SIZEOF,d0
  72.     move.l  #MEMF_PUBLIC!MEMF_CLEAR,d1
  73.     jsr     _LVOAllocMem(a6)
  74.     move.l  d0,a5
  75.     bne.s   LibraryO
  76.     moveq   #21,d7           ;21 = kein Speicher
  77.     bra.s   Ende
  78. LibraryO
  79.     bsr.w   InitRelative
  80.     bsr.w   LibOeffne
  81.     tst.w   d7
  82.     bne.s   SchliesseLibrary
  83.     bsr.s   Parameter
  84.     tst.w   d7
  85.     bne.s   SchliesseLibrary
  86.     bsr.s   WaitOnCaps
  87.     cmp.w   #10,d7
  88.     bhi.s   SchliesseLibrary
  89.     tst.w   d7
  90.     beq.s   Menuerscheine
  91.     moveq   #0,d7
  92.     bra.s   SchliesseLibrary
  93. Menuerscheine
  94.     bsr.w   PubScreenOeffne
  95.     tst.w   d7
  96.     bne.s   SchliesseLibrary
  97.     bsr.w   LadePrefs
  98.     tst.w   d7
  99.     bne.s   SchliesseScreen
  100.     bsr.w   InitGadget
  101.     tst.w   d7
  102.     bne.s   FreiSPrefs
  103.     bsr.w   FensterOeffne
  104.     tst.w   d7
  105.     bne.s   RemGad
  106.     bsr.w   GadAktivieren
  107.     bsr.w   RefreshWin
  108.     bsr.w   MessageAbFragen
  109.     bsr.w   FensterSchliesse
  110. RemGad
  111.     bsr.w   RemoveGadget
  112. FreiSPrefs
  113.     bsr.w   SpeicherPrefs
  114. SchliesseScreen
  115.     bsr.w   ScreenSchliesse
  116. SchliesseLibrary
  117.     bsr.w   LibSchliesse
  118.     move.l  a5,a1
  119.     move.l  #Int_SIZEOF,d0
  120.     jsr     _LVOFreeMem(a6)
  121. Ende
  122.     move.l  d7,d0
  123. ende
  124.     rts
  125. ;;
  126. ** Parameter
  127. Parameter
  128.     move.l  DOSBase(a5),a6
  129.     lea     ParaTemplate(pc),a1
  130.     move.l  a1,d1
  131.     lea     NOKEYArray(a5),a1
  132.     move.l  a1,d2
  133.     moveq   #0,d3
  134.     jsr     _LVOReadArgs(a6)
  135.     move.l  d0,RDArgs(a5)
  136.     bne.s   ParaOK
  137.     jsr     _LVOIoErr(a6)
  138.     move.l  d0,d1
  139.     moveq   #0,d2
  140.     jsr     _LVOPrintFault(a6)
  141.     moveq   #32,d7
  142.     rts
  143. ParaOK
  144.     move.l  RDArgs(a5),d1
  145.     jsr     _LVOFreeArgs(a6)
  146.     rts
  147. ;;
  148. ** Warte auf Caps Lock
  149. WaitOnCaps
  150.     tst.l   NOKEYArray(a5)
  151.     bne.s   NOKeyJA
  152.     move.l  4.w,a6
  153.     jsr     _LVOCreateMsgPort(a6)
  154.     move.l  d0,MsgPortAddr(a5)
  155.     bne.s   MsgPortOK
  156.     moveq   #29,d7                  ;29 = kein MsgPort
  157.     addq    #4,a7
  158.     pea     SchliesseLibrary(pc)
  159.     rts
  160. MsgPortOK
  161.     move.l  d0,a0
  162.     move.l  #IOSTD_SIZE,d0
  163.     jsr     _LVOCreateIORequest(a6)
  164.     move.l  d0,TastenIBlock(a5)
  165.     bne.s   OeffneDev
  166.     moveq   #30,d7                  ;30=konnte kein IORequest create
  167.     bra.s   FreiMsgP
  168. OeffneDev
  169.     lea     inputname(pc),a0
  170.     move.l  d0,a1
  171.     moveq   #0,d0
  172.     move.l  #IOF_QUICK,d1
  173.     jsr     _LVOOpenDevice(a6)
  174.     tst.l   d0
  175.     beq.s   DevOK
  176.     moveq   #31,d7                   ;31=konnte Device nicht öffnen
  177.     bra.s   IOReqDel
  178. DevOK
  179.     move.l  TastenIBlock(a5),a0
  180.     move.l  IO_DEVICE(a0),a6
  181.     jsr     _LVOPeekQualifier(a6)
  182.     and.w   #IEQUALIFIER_CAPSLOCK,d0
  183.     cmp.w   #IEQUALIFIER_CAPSLOCK,d0
  184.     beq.s   CAPSgedrueckt
  185.     moveq   #10,d7
  186. CAPSgedrueckt
  187.     move.l  4.w,a6
  188.     lea     TastenIBlock(a5),a1
  189.     jsr     _LVOCloseDevice(a6)
  190. IOReqDel
  191.     move.l  TastenIBlock(a5),a0
  192.     jsr     _LVODeleteIORequest(a6)
  193. FreiMsgP
  194.     move.l  MsgPortAddr(a5),a0
  195.     jsr     _LVODeleteMsgPort(a6)
  196. NOKeyJA
  197.     rts
  198. ;;
  199. ** GadAktivieren
  200. GadAktivieren
  201.     move.l  GadgetAddr(a5),a4
  202.     moveq   #1,d6
  203.     bsr.w   SelGK
  204.     lea     GadgetAddr(a5),a4
  205.     move.l  a4,AnGad(a5)
  206.     rts
  207. ;;
  208. ** Relative Init
  209. InitRelative
  210.     lea     topazFName8(pc),a0
  211.     lea     topaz8(pc),a1
  212.     move.l  a0,(a1)
  213.     move.l  a1,FontAddr(a5)
  214.     rts
  215. ;;
  216. ** Message Auswertung
  217. MessageAbFragen
  218.     move.l  WindowHandle(a5),a0
  219.     move.l  wd_UserPort(a0),a0
  220.     move.l  4.w,a6
  221.     jsr     _LVOWaitPort(a6)
  222. nocheine
  223.     move.l  GADBase(a5),a6
  224.     move.l  WindowHandle(a5),a0
  225.     move.l  wd_UserPort(a0),a0
  226.     jsr     _LVOGT_GetIMsg(a6)
  227.     move.l  d0,a1
  228.     tst.l   d0
  229.     beq.s   MessageAbFragen
  230.     move.l  im_Class(a1),d4
  231.     move.w  im_Code(a1),d5
  232.     move.l  im_IAddress(a1),a4
  233.     jsr     _LVOGT_ReplyIMsg(a6)
  234.     cmpi.l  #IDCMP_CLOSEWINDOW,d4
  235.     beq.w   ende
  236.     cmpi.l  #IDCMP_REFRESHWINDOW,d4
  237.     beq.s   RefreWin
  238.     cmpi.l  #IDCMP_GADGETUP,d4
  239.     beq.w   GadAuswertung
  240.     cmpi.l  #IDCMP_VANILLAKEY,d4
  241.     beq.w   VTastendruck
  242.     cmpi.l  #IDCMP_RAWKEY,d4
  243.     beq.w   RTastendruck
  244.     bra.s   nocheine
  245. RefreWin
  246.     bsr.w   RefreshWin
  247.     bra.s   nocheine
  248. UpTaste
  249.     move.l  AnGad(a5),a4
  250.     lea     GadgetAddr(a5),a3
  251.     cmp.l   a3,a4
  252.     beq.s   DownTEnde
  253.     lea     -4(a4),a3
  254.     bra.s   GadAnwaehlen
  255. DownTaste
  256.     move.l  AnGad(a5),a4
  257.     lea     4(a4),a3
  258.     cmp.l   #0,(a3)
  259.     beq.s   DownTEnde
  260. GadAnwaehlen
  261.     move.l  (a4),a4
  262.     moveq   #0,d6
  263.     bsr.w   SelGK
  264.     moveq   #1,d6
  265.     move.l  (a3),a4
  266.     bsr.w   SelGK
  267.     move.l  (a3),a3
  268.     bsr.w   GetGAddr
  269. DownTEnde
  270.     bra.w   nocheine
  271. rechteBank
  272.     bsr.s   NummerGad
  273.     add.w   #17,d0
  274.     cmp.b   AnzahlGADs(a5),d0
  275.     bls.s   rechtsOK
  276.     sub.b   AnzahlGADs(a5),d0
  277.     neg.w   d0
  278.     add.w   #17,d0
  279.     bra.s   rechtsweiter
  280. rechtsOK
  281.     moveq   #17,d0
  282. rechtsweiter
  283.     asl.w   #2,d0
  284.     lea     (a4,d0.w),a3            
  285.     bra.s   GadAnwaehlen
  286. NummerGad
  287.     move.l  AnGad(a5),a4    
  288.     move.l  (a4),a3
  289.     move.w  gg_GadgetID(a3),d0
  290.     rts
  291. linkeBank
  292.     bsr.s   NummerGad
  293.     sub.w   #18,d0
  294.     tst.w   d0
  295.     bgt.s   linksOk
  296.     moveq   #0,d0
  297. linksOk
  298.     asl.w   #2,d0
  299.     lea     GadgetAddr(a5),a3
  300.     lea     (a3,d0.w),a3                            
  301.     bra.s   GadAnwaehlen
  302. RTastendruck
  303.     cmp.b   #$4e,d5         ;rechts
  304.     beq.b   rechteBank
  305.     cmp.b   #$4f,d5         ;links
  306.     beq.s   linkeBank
  307.     cmp.b   #$4d,d5         ;Down
  308.     beq.w   DownTaste
  309.     cmp.b   #$4c,d5         ;Up
  310.     beq.w   UpTaste
  311.     bra.w   nocheine
  312. VTastendruck
  313.     cmp.b   #$0d,d5
  314.     beq.s   Auswahl
  315.     cmp.b   #$1b,d5
  316.     beq.w   ende
  317.     bclr    #5,d5
  318.     cmp.b   #'Q',d5
  319.     beq.w   ende
  320.     bra.w   nocheine
  321. GetGAddr
  322.     lea     GadgetAddr(a5),a4
  323. FindeGAdd
  324.     cmp.l   (a4)+,a3
  325.     beq.s   RichtGAdd
  326.     bra.s   FindeGAdd
  327. RichtGAdd
  328.     lea     -4(a4),a4
  329.     move.l  a4,AnGad(a5)
  330.     rts
  331. SelGK
  332.     move.l  WindowHandle(a5),a0
  333.     bsr.b   RemoveGSuche
  334.     tst.l   d6
  335.     beq.s   DisSel
  336.     or.w    #GFLG_SELECTED,gg_Flags(a4)
  337.     bra.s   NunSel
  338. DisSel
  339.     eor.w   #GFLG_SELECTED,gg_Flags(a4)
  340. NunSel
  341.     move.l  WindowHandle(a5),a0
  342.     bsr.b   AddGSuche
  343.     rts
  344. RemoveGSuche
  345.     move.l  a4,a1
  346.     move.l  INTUIBase(a5),a6
  347.     jsr     _LVORemoveGadget(a6)
  348.     rts
  349. AddGSuche
  350.     move.l  WindowHandle(a5),a0
  351.     move.l  a4,a1
  352.     moveq   #-1,d0
  353.     jsr     _LVOAddGadget(a6)
  354.     move.l  a4,a0
  355.     move.l  WindowHandle(a5),a1
  356.     suba.l  a2,a2
  357.     jsr     _LVORefreshGadgets(a6)
  358.     rts
  359. Auswahl
  360.     move.l  AnGad(a5),a4
  361.     move.l  (a4),a4
  362. GadAuswertung
  363.     move.w  gg_GadgetID(a4),d6
  364.     asl.b   #1,d6
  365.     subq    #2,d6
  366.     move.l  FileSpeicher(a5),a1
  367. SucheExloop
  368.     cmp.b   #0,(a1)+
  369.     bne.s   SucheExloop
  370.     dbra    d6,SucheExloop
  371.     move.l  a1,d1
  372.     moveq   #0,d2
  373.     moveq   #0,d3
  374.     move.l  DOSBase(a5),a6
  375.     jsr     _LVOExecute(a6)
  376.     moveq   #10,d7
  377.     rts
  378. ;;
  379. ** Refresh Fenster
  380. RefreshWin
  381.     move.l  GADBase(a5),a6
  382.     move.l  WindowHandle(a5),a0
  383.     suba.l  a1,a1
  384.     jsr     _LVOGT_RefreshWindow(a6)
  385.     move.l  WindowHandle(a5),a0
  386.     jsr     _LVOGT_BeginRefresh(a6)
  387.     move.l  WindowHandle(a5),a0
  388.     moveq   #DOSTRUE,d0
  389.     jsr     _LVOGT_EndRefresh(a6)
  390.     rts 
  391. ;;
  392. ** Fenster Öffnen
  393. FensterOeffne
  394.     move.l  INTUIBase(a5),a6
  395.     lea     Fenster_Tags(pc),a1
  396.     move.l  GadgetListe(a5),12(a1)
  397.     lea     WindowTitle(pc),a0
  398.     move.l  a0,4(a1)
  399.     lea     ScreenTitle(pc),a0
  400.     move.l  a0,20(a1)
  401.     move.w  BreiteGADs(a5),d0
  402.     add.w   #40,d0
  403.     move.w  d0,30(a1)
  404.     sub.w   #640,d0
  405.     neg.w   d0
  406.     asr.w   #1,d0
  407.     move.w  d0,54(a1)
  408.     move.w  BreiteWin(a5),d4
  409.     bne.s   BreiteresWin
  410.     move.b  AnzahlGADs(a5),d4
  411. BreiteresWin    
  412.     move.w  d4,d6
  413.     move.w  d6,d5
  414.     add.w   d6,d5
  415.     asl.w   #3,d4
  416.     add.w   d5,d4
  417.     add.w   #36,d4
  418.     move.w  d4,38(a1)
  419.     move.w  #252,d0
  420.     sub.w   d4,d0
  421.     asr.w   #1,d0
  422.     move.w  d0,46(a1)
  423.     suba.l  a0,a0
  424.     jsr     _LVOOpenWindowTagList(a6)
  425.     move.l  d0,WindowHandle(a5)
  426.     beq.b   ErrorWindow
  427.     move.l  4.w,a6
  428.     suba.l  a1,a1
  429.     jsr     _LVOFindTask(a6)
  430.     move.l  d0,meinTask(a5)
  431.     beq.s   ErrorTask
  432.     move.l  d0,a0
  433.     move.l  pr_WindowPtr(a0),alterTask(a5)
  434.     move.l  WindowHandle(a5),pr_WindowPtr(a0)
  435.     rts
  436. ErrorTask
  437.     bsr.s   keinTask
  438. ErrorWindow
  439.     moveq   #26,d7           ;26 = konnte Fenster nicht öffnen oder Task nicht finden
  440.     rts
  441. FensterSchliesse
  442.     move.l  meinTask(a5),a0
  443.     move.l  alterTask(a5),pr_WindowPtr(a0)
  444. keinTask
  445.     move.l  INTUIBase(a5),a6
  446.     move.l  WindowHandle(a5),a0
  447.     jsr     _LVOCloseWindow(a6)
  448.     rts 
  449. ;;
  450. ** Init Gadgets
  451. InitGadget
  452.     move.l  ScreenHandle(a5),a0
  453.     move.l  sc_Font(a0),a1
  454.     move.w  ta_YSize(a1),d2
  455.     add.b   sc_WBorTop(a0),d2
  456.     addq    #1,d2
  457.     move.b  d2,RelativeTopC(a5)
  458.     move.b  sc_WBorTop(a0),RelativeLeftC(a5)
  459.     move.l  FileSpeicher(a5),a1
  460.     move.l  Filegroesse(a5),d0
  461.     move.l  a1,a2
  462.     add.l   d0,a2
  463.     moveq   #0,d0
  464.     moveq   #0,d1
  465.     moveq   #0,d2
  466.     moveq   #0,d3
  467. Suchenloop
  468.     addq    #1,d1
  469.     move.b  (a1)+,d4
  470.     bclr    #5,d4
  471.     cmp.b   #'E',d4
  472.     beq.s   VielleichtENDE
  473. einReturn
  474.     cmp.b   #10,-1(a1)
  475.     bne.s   keinReturn
  476.     move.b  #0,-1(a1)
  477.     tst.b   d3
  478.     beq.s   BreiteZaehlen
  479.     moveq   #0,d3
  480.     bra.s   wortkleiner
  481. BreiteZaehlen
  482.     moveq   #1,d3   
  483.     addq    #1,d0
  484.     cmp.b   d2,d1
  485.     bls.s   wortkleiner
  486.     move.b  d1,d2
  487. wortkleiner
  488.     moveq   #0,d1
  489. keinReturn
  490.     cmp.l   a1,a2
  491.     beq.s   PrefsEnde
  492.     bra.s   Suchenloop
  493. VielleichtENDE
  494.     move.b  (a1)+,d4
  495.     bclr    #5,d4
  496.     cmp.b   #'N',d4
  497.     bne.s   einReturn
  498.     move.b  (a1)+,d4
  499.     bclr    #5,d4
  500.     cmp.b   #'D',d4
  501.     bne.s   einReturn
  502.     move.b  (a1)+,d4
  503.     bclr    #5,d4
  504.     cmp.b   #'E',d4
  505.     bne.s   einReturn
  506. PrefsEnde
  507.     tst.b   d0
  508.     beq.w   PrefsNull
  509.     move.b  d0,AnzahlGADs(a5)
  510.     asl.w   #3,d2
  511.     add.w   #10,d2
  512.     move.w  d2,BreiteGADs(a5)
  513.     lea     GadgetListe(a5),a0
  514.     move.l  GADBase(a5),a6
  515.     jsr     _LVOCreateContext(a6)
  516.     move.l  d0,a0
  517.     beq.w   ErrorGadget
  518.     lea     UniGad(pc),a1
  519.     move.b  RelativeTopC(a5),d2
  520.     move.b  RelativeLeftC(a5),d3
  521.     add.b   d2,gng_TopEdge+1(a1)
  522.     add.b   d3,gng_LeftEdge+1(a1)
  523.     move.w  BreiteGADs(a5),gng_Width(a1)
  524.     move.l  VisualInfo(a5),gng_VisualInfo(a1)
  525.     move.l  FontAddr(a5),gng_TextAttr(a1)
  526.     move.l  FileSpeicher(a5),a4
  527.     moveq   #0,d6
  528.     move.b  AnzahlGADs(a5),d6
  529.     subq    #1,d6
  530.     lea     GadgetAddr(a5),a3
  531. InitGadloop
  532.     moveq   #BUTTON_KIND,d0
  533.     lea     UniGad(pc),a1
  534.     move.l  a4,gng_GadgetText(a1)
  535.     bsr.s   Return2Find
  536.     cmp.w   #180,gng_TopEdge(a1)
  537.     bge.s   GadgetCorritur
  538. GadgetCoOK      
  539.     add.w   #10,gng_TopEdge(a1)
  540.     add.w   #1,gng_GadgetID(a1)
  541.     suba.l  a2,a2
  542.     jsr     _LVOCreateGadgetA(a6)
  543.     move.l  d0,(a3)+
  544.     beq.s   ErrorGadget
  545.     move.l  d0,a0
  546.     dbra    d6,InitGadloop
  547.     rts
  548. GadgetCorritur
  549.     clr.w   gng_TopEdge(a1)
  550.     move.b  RelativeTopC(a5),d2
  551.     add.b   d2,gng_TopEdge+1(a1)
  552.     move.w  BreiteGADs(a5),d2
  553.     add.w   #20,d2
  554.     add.w   d2,BreiteGADs(a5)
  555.     add.w   d2,gng_LeftEdge(a1)
  556.     move.w  #17,BreiteWin(a5)      
  557.     bra.s   GadgetCoOK                      
  558. ErrorGadget
  559.     bsr.s   RemoveGadget
  560.     moveq   #25,d7           ;25 = Gadget init Fehler
  561.     rts
  562. RemoveGadget
  563.     move.l  GADBase(a5),a6
  564.     move.l  GadgetListe(a5),a0
  565.     jsr     _LVOFreeGadgets(a6)
  566.     rts 
  567. Return2Find
  568.     cmp.b   #0,(a4)+
  569.     bne.s   Return2Find
  570. Return1Mal
  571.     cmp.b   #0,(a4)+
  572.     bne.s   Return1Mal
  573.     rts
  574. PrefsNull
  575.     moveq   #27,d7           ;27 = Prefs sind Null
  576.     rts
  577. ;;
  578. ** Speicher freigeben von den Einstellungen
  579. SpeicherPrefs
  580.     move.l  FileSpeicher(a5),a1
  581.     move.l  Filegroesse(a5),d0
  582.     move.l  4.w,a6
  583.     jsr     _LVOFreeMem(a6)
  584.     rts
  585. ;;
  586. ** Lade Einstellungen
  587. LadePrefs
  588.     lea     PrefsFile1(pc),a3
  589.     move.l  a3,d1
  590.     move.l  #MODE_OLDFILE,d2
  591.     move.l  DOSBase(a5),a6
  592.     jsr     _LVOOpen(a6)
  593.     move.l  d0,PrefsFileHandle(a5)
  594.     bne.s   OpenPrefsFile
  595.     lea     PrefsFileName(pc),a3
  596.     move.l  a3,d1
  597.     move.l  #MODE_OLDFILE,d2
  598.     jsr     _LVOOpen(a6)
  599.     move.l  d0,PrefsFileHandle(a5)
  600.     beq.s   OpenFileError
  601. OpenPrefsFile
  602.     move.l  d0,d1
  603.     lea     FIB(a5),a3
  604.     move.l  a3,d2
  605.     jsr     _LVOExamineFH(a6)
  606.     move.l  fib_Size(a3),Filegroesse(a5)
  607.     move.l  Filegroesse(a5),d0
  608.     cmp.l   #1,d0
  609.     beq.s   nixPrefs
  610.     tst.l   d0
  611.     beq.s   nixPrefs
  612.     move.l  #MEMF_PUBLIC!MEMF_CLEAR,d1
  613.     move.l  4.w,a6
  614.     jsr     _LVOAllocMem(a6)
  615.     move.l  d0,FileSpeicher(a5)
  616.     beq.s   ErrorFiSp
  617.     move.l  PrefsFileHandle(a5),d1
  618.     move.l  d0,d2
  619.     move.l  Filegroesse(a5),d3
  620.     move.l  DOSBase(a5),a6
  621.     jsr     _LVORead(a6)
  622. SchliesseFile
  623.     move.l  PrefsFileHandle(a5),d1
  624.     jsr     _LVOClose(a6)
  625.     rts
  626. ErrorFiSp
  627.     moveq   #28,d7           ;28 = kein Speicher für Prefs
  628.     bra.s   SchliesseFile
  629. OpenFileError
  630.     moveq   #24,d7           ;24 = konnte File BangerMenu.prefs nicht öffnen
  631.     rts
  632. nixPrefs
  633.     moveq   #27,d7           ;27 = Prefs vorhanden aber leer
  634.     bra.s   SchliesseFile
  635. ;;
  636. ** Library Öffnen + Schliessen
  637. LibOeffne
  638.     move.l  a5,a4
  639.     lea     intname(pc),a1
  640.     bsr.s   OeffneLib
  641.     lea     dosname(pc),a1
  642.     bsr.s   OeffneLib
  643.     lea     gadname(pc),a1
  644.     bsr.s   OeffneLib
  645.     rts
  646. OeffneLib
  647.     moveq   #37,d0
  648.     jsr     _LVOOpenLibrary(a6)
  649.     move.l  d0,(a4)+
  650.     beq.s   LibError
  651.     rts
  652. LibError
  653.     moveq   #22,d7                   ;22 = konnte Library nicht öffnen
  654.     rts
  655. LibSchliesse
  656.     move.l  4.w,a6
  657.     moveq   #3-1,d2
  658.     lea     WindowHandle(a5),a4
  659. SchliesseLib
  660.     move.l  -(a4),a1
  661.     cmp.l   #0,a1
  662.     beq.s   notOpened
  663.     jsr     _LVOCloseLibrary(a6)
  664. notOpened
  665.     dbra    d2,SchliesseLib
  666.     rts
  667. ;;
  668. ** PubScreenOeffne
  669. PubScreenOeffne
  670.     move.l  INTUIBase(a5),a6
  671.     suba.l  a0,a0
  672.     jsr     _LVOLockPubScreen(a6)
  673.     move.l  d0,ScreenHandle(a5)
  674.     move.l  d0,a0
  675.     suba.l  a1,a1
  676.     move.l  GADBase(a5),a6
  677.     jsr     _LVOGetVisualInfoA(a6)
  678.     move.l  d0,VisualInfo(a5)
  679.     beq.s   VisualError
  680.     rts
  681. VisualError
  682.     moveq   #23,d7                  ;23 = GetVisualInfo Fehler
  683.     bra.s   ScrSchliesse
  684. ScreenSchliesse
  685.     move.l  GADBase(a5),a6
  686.     move.l  VisualInfo(a5),a0
  687.     jsr     _LVOFreeVisualInfo(a6)
  688. ScrSchliesse
  689.     move.l  INTUIBase(a5),a6
  690.     suba.l  a0,a0
  691.     move.l  ScreenHandle(a5),a1
  692.     jsr     _LVOUnlockPubScreen(a6)
  693.     rts
  694. ;;
  695. ** LONG Daten
  696. Fenster_Tags    dc.l    WA_Title,0
  697.         dc.l    WA_Gadgets,0
  698.         dc.l    WA_ScreenTitle,0
  699.         dc.l    WA_Width,0
  700.         dc.l    WA_Height,0
  701.         dc.l    WA_Top,11
  702.         dc.l    WA_Left,0
  703.         dc.l    WA_IDCMP,IDCMP1!IDCMP2
  704.         dc.l    WA_Flags,W_Flags1!W_Flags2
  705.         dc.l    WA_NewLookMenus,-1
  706.         dc.l    WA_AutoAdjust,-1
  707.         dc.l    TAG_DONE
  708. W_Flags1        equ     WFLG_ACTIVATE!WFLG_SMART_REFRESH
  709. W_Flags2        equ     WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_CLOSEGADGET
  710. IDCMP1          equ     BUTTONIDCMP!RAWKEY
  711. IDCMP2          equ     IDCMP_CLOSEWINDOW!IDCMP_VANILLAKEY!IDCMP_REFRESHWINDOW
  712. UniGad
  713.         dc.w    20,0,0,10
  714.         dc.l    0,0
  715.         dc.w    0
  716.         dc.l    PLACETEXT_IN,0,0 
  717. topaz8:
  718.         dc.l    0
  719.         dc.w    8
  720.         dc.b    0,1
  721. ;;
  722. ** BYTE Daten
  723. ParaTemplate    dc.b 'NOKEY/S',0
  724. intname         INTUITIONNAME
  725. dosname         DOSNAME
  726. gadname         GADTOOLSNAME
  727. inputname       dc.b    'input.device',0
  728. PrefsFileName   dc.b    'S:'
  729. PrefsFile1      dc.b    'BangerMenu.prefs',0
  730. topazFName8     dc.b    'topaz.font',0
  731. WindowTitle     dc.b    'Banger',0
  732.                 dc.b    '$VER: '
  733. ScreenTitle     dc.b    'BangerMenu 1.210 (30-Aug-1995) © BY Andre´'
  734.         dc.b    ' Trettin',10,0
  735. ;;
  736.